<template>
    <!-- 弹跳加载器 -->
    <div v-show="isLoading">
        <div class="bounce-loader">
            <div class="bounce-dot"></div>
            <div class="bounce-dot"></div>
            <div class="bounce-dot"></div>
        </div>
        <p class="loader-text">正在处理数据...</p>
    </div>
</template>

<script setup>
const props = defineProps({
  isLoading: {
    type: Boolean,
    required: true
  }
})

//启动加载器
const startLoading = () => {
  isLoading.value = true
}

//关闭加载器
const stopLoading = () => {
  isLoading.value = false
}
</script>

<style scoped>
/* 弹跳加载动画 */
.bounce-loader {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 60px;
    margin-bottom: 15px;
}

.bounce-dot {
    width: 18px;
    height: 18px;
    margin: 0 6px;
    background: #3498db;
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
}

.bounce-dot:nth-child(1) {
    animation-delay: -0.32s;
}

.bounce-dot:nth-child(2) {
    animation-delay: -0.16s;
}

.loader-text {
    font-size: 1.1rem;
    color: #3498db;
    font-weight: 500;
    text-align: center;
}

@keyframes bounce {

    0%,
    80%,
    100% {
        transform: scale(0);
    }

    40% {
        transform: scale(1);
    }
}
</style>